<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<!-- saved from url=(0037)http://home.no.net/tkos/info/fat.html -->

<!-- saved from url=(0037)http://home.no.net/tkos/info/fat.html --><HTML>
<!-- Mirrored from bos.asmhackers.net/docs/filesystems/fat12-16-32/docs/File Allocation Table.htm by HTTrack Website Copier/3.x [XR&CO'2013], Tue, 07 Oct 2014 11:25:36 GMT -->
<HEAD><TITLE>File Allocation Table</TITLE>

<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>

<META content="MSHTML 5.00.2919.6307" name=GENERATOR></HEAD>

<BODY bgColor=#c0c0c0 link=#000080> 

<DIV align=center>

<CENTER>

<TABLE border=0 cellPadding=0 width="80%">

  <TBODY>

  <TR>

    <TD width="100%">

      <P align=center><STRONG><B><FONT face=Impact size=6>File Allocation 

      Table</FONT></B></STRONG></P>

      <P align=center>How It Seems To Work</P>

      <P align=right><FONT face=Arial size=2><I>Thomas Kjoernes,<BR>Thu, 11th of 

      May 2000</I></FONT></P>

      <P><FONT face=Arial size=2><B>Introduction</B></FONT></P>

      <P><FONT face=Arial size=2>In this article I will talk about FAT, the 

      MS-DOS file system supported by most of today's OSes.</FONT></P>

      <P><FONT face=Arial size=2>I will start out by explaining a little bit 

      about the various flavours of FAT as used by MS-DOS, then I&#8217;ll move on to 

      explaining the various parts that make up the FAT file system and describe 

      the structures </FONT></P>

      <P><FONT face=Arial size=2>Some FAT source code and 

information:</FONT></P>

      <BLOCKQUOTE>

        <P><A href="http://home.no.net/tkos/os.zip"><FONT face=Arial 

        size=2>OS.ZIP</FONT></A><FONT face=Arial size=2> - This is my OS 

        package! It contains three boot sector sources.</FONT></P>

        <P><A href="http://home.no.net/tkos/info/fat32.html"><FONT face=Arial 

        size=2>FAT32.HTML</FONT></A><FONT face=Arial size=2> - This is an 

        excerpt from the FAT32API.HLP file from Microsoft.</FONT></P>

        <P><A href="http://home.no.net/tkos/info/fat12.asm"><FONT face=Arial 

        size=2>FAT12.ASM</FONT></A><FONT face=Arial size=2> - Example of a FAT12 

        boot sector.</FONT></P>

        <P><A href="http://home.no.net/tkos/info/fat16.asm"><FONT face=Arial 

        size=2>FAT16.ASM</FONT></A><FONT face=Arial size=2> - Example of a FAT16 

        boot sector.</FONT></P>

        <P><A href="http://home.no.net/tkos/info/fat32.asm"><FONT face=Arial 

        size=2>FAT32.ASM</FONT></A><FONT face=Arial size=2> - Example of a FAT32 

        boot sector.</FONT></P></BLOCKQUOTE>

      <P><FONT face=Arial size=2>I will try to update this document with sample 

      code and descriptions of how to interpret the FAT and perform common 

      operations, such as searching for and reading/writing 

files.<BR></FONT></P>

      <P><FONT face=Arial size=2><B>FAT Types</B></FONT></P>

      <P><FONT face=Arial size=2>Today FAT comes in three different flavours &#8211; 

      FAT12, FAT16 and FAT32. The names refer to the number of bits used by the 

      entries in table that gave the file system its name!</FONT></P>

      <P><FONT face=Arial size=2>The "File Allocation Table" itself is actually 

      one of the structures inside the FAT file system as seen on-disk. The 

      purpose of this table is to keep track of which areas of the disk are 

      available and which areas are in use.</FONT></P>

      <P><FONT face=Arial size=2>Another important part about FAT is the "Long 

      File Name" extension to FAT sometimes referred to as VFAT. The terms LFN 

      and VFAT are closely related, but VFAT really means just Virtual 

      FAT.</FONT></P>

      <P><FONT face=Arial size=2><B>FAT Overview</B></FONT></P>

      <P><FONT face=Arial size=2>It&#8217;s time to get slightly technical. I&#8217;ll first 

      just mention all the structures almost in the order in which they usually 

      appear inside the partition. When talking about the order of things I&#8217;m 

      referring to order as seen through the Logical Block Address of a 

      particular structure.</FONT></P>

      <P><FONT face=Arial size=2><U>Cluster</U></FONT></P>

      <P><FONT face=Arial size=2>This term is very fundamental for FAT. A 

      cluster is a group of sectors on the FAT media. Only the part of the 

      partition called the "data area" is divided into clusters. The rest of the 

      partition is simply sectors.</FONT></P>

      <P><FONT face=Arial size=2>Files and directories store their data in these 

      clusters. The size of one cluster is specified in a structure called the 

      Boot Record and can range from a single sector to 128 

sector(s).</FONT></P>

      <P><FONT face=Arial size=2><U>Boot Record</U></FONT></P>

      <P><FONT face=Arial size=2>All the three flavours of FAT have a Boot 

      Record, which is located within an area of reserved sectors. The DOS 

      format program reserves 1 sector for FAT12 and FAT16 and usually 32 

      sectors for FAT32.</FONT></P>

      <DIR>

      <LI><FONT face=Arial size=2><I>FAT overview from MS:</I></FONT> 

      <P><FONT face=Arial size=2>Microsoft has recently made a document 

      available that attempts to teach us about FAT. The document is good as a 

      reference if you already know something about FAT, but it&#8217;s not very good 

      at describing how to actually use the information. The document can be 

      found at - </FONT><A href="http://www.microsoft.com/hwdev"><FONT 

      size=2>http://www.microsoft.com/hwdev</FONT></A><FONT face=Arial 

      size=2>.</FONT></P>

      <P><FONT face=Arial size=2>I will not attempt to duplicate all the 

      technical documentation presented in that document. I suggest you get it 

      and read if you a very detailed explanation of every single field in the 

      Boot Record for instance.</FONT></P></LI></DIR>

      <P><FONT face=Arial size=2><U>File Allocate Table</U></FONT></P>

      <P><FONT face=Arial size=2>The actual "File Allocation Table" structure is 

      a relatively simple structure, as are all of the FAT structures really. 

      The FAT is a simple array of 12-bit, 16-bit or 32-bit data elements. 

      Usually there will be two identical copies of the FAT. </FONT></P>

      <P><FONT face=Arial size=2>There is a field in the Boot Record that 

      specifies the number of FAT copies. With FAT12 and FAT16, MS-DOS uses only 

      the first copy, but the other copies are kept in sync. FAT32 was enhanced 

      to specify which FAT copy is the active one in a 4-bit value part of a 

      "Flags" field.</FONT></P>

      <P><FONT face=Arial size=2>It&#8217;s quite common to think of the FAT as a 

      singly linked list. Each of the chains in the FAT specify which parts of 

      the disk belong to a given file or directory.</FONT></P>

      <P><FONT face=Arial size=2><U>Root Directory</U></FONT></P>

      <P><FONT face=Arial size=2>The Root Directory is formatted like any other 

      directory except it does not contain the "dot" and "dot-dot" entries. See 

      the details section for more information. The root directory can always be 

      found immediately following the file allocation table(s) for FAT12 and 

      FAT16 volumes.</FONT></P>

      <P><FONT face=Arial size=2><U>Data Area</U></FONT></P>

      <P><FONT face=Arial size=2>Time has come to describe the user data area. 

      What is there to say really? The user data area (or just data area if you 

      like) is where the contents of files and directories are stored. Simple as 

      that&#8230;</FONT></P>

      <P><FONT face=Arial size=2>See the formulas above for how to calculate the 

      size of the data area. And yes, the data area is divided into sector 

      groups called <U>clusters</U>. All the clusters in a single FAT volume 

      have the same size.</FONT></P>

      <P><FONT face=Arial size=2>To further educate you, the term <U>slack 

      space</U> refers to any unused space at the end of a cluster and cannot be 

      used by any other file or directory.</FONT></P>

      <P><FONT face=Arial size=2>Note that directories are not known to suffer 

      from slack space problems. This is simply because the exact size in bytes 

      of a directory is not recorded as with files and generally no one seem to 

      care anyway.</FONT></P>

      <P><FONT face=Arial size=2>The data area section will not be explained in 

      detail. There is simply nothing more to say about it. Information on how 

      to access files and directories is the closest we get to data area 

      details.</FONT></P>

      <P><FONT face=Arial size=2><U>Wasted Sectors</U></FONT></P>

      <P><FONT face=Arial size=2>If the number of data sectors is not evenly 

      divisible by the cluster size you end up with a few wasted data sectors. 

      Also if the partition as declared in the <U>partition table</U> is larger 

      than what is claimed in the Boot Record the volume can be said to have 

      wasted sectors.</FONT></P>

      <P><FONT face=Arial size=2>If you are not familiar with the term partition 

      table, I suggest that you go to Hale Landis&#8217; web site and look for the How 

      It Works series of documents at - </FONT><A 

      href="http://www.ata-atapi.com/"><FONT face=Arial 

      size=2>http://www.ata-atapi.com</FONT></A><FONT face=Arial 

      size=2>.</FONT></P>

      <P><FONT face=Arial size=2><B>Boot Record Details</B></FONT></P>

      <P><FONT face=Arial size=2>The Boot Record is located at the very 

      beginning of a FAT volume. FAT12 and FAT16 boot sectors occupy a single 

      sector while FAT32 boot sectors are generally said to consist of three 

      sectors. </FONT></P>

      <P><FONT face=Arial size=2>The first sector of the volume or the first few 

      sectors are also known as the "reserved" sectors or the reserved area. The 

      Reserved_Sectors field in the boot record tells us how large this area is. 

      Note that the first FAT follows directly after the reserved 

      area.</FONT></P>

      <P><FONT face=Arial size=2>As mentioned in the overview section, the DOS 

      format program reserves 1 sector for FAT12 and FAT16 and usually 32 

      sectors for FAT32. The reserved area for FAT32 contains not only the boot 

      record but also a backup copy of the boot record.</FONT></P>

      <P><FONT face=Arial size=2>The boot record includes a field describing the 

      sector size for the media and it is possible to have a boot record size 

      different than the 512-byte commonly seen on harddisks and diskettes 

      (usually seen on RAM-disks).</FONT></P>

      <P><FONT face=Arial size=2>Inside the boot record there is a structure 

      called the BPB or BIOS Parameter Block. This structure is what really 

      makes up the boot record. To further complicate things there are different 

      versions of the boot record as well. Basically, as storage technology 

      developed and disks got bigger, a few new fields were added to the boot 

      record to support larger disk sizes.</FONT></P>

      <P><FONT face=Arial size=2>Of course being a lazy person, I will 

      completely ignore the older boot record layouts and concentrate on the 

      most current implementation. The structure definitions that follows come 

      from one of the include files used by my OS &#8211; FAT.INC.</FONT></P>

      <P><FONT face=Arial size=2>I only attempt to show you the layout of the 

      BPB and remaining boot sector structures. If you want details of the 

      purpose of each field and what they may and may not contain I urge you to 

      read the Microsoft FAT overview document, which describes this quite 

      well.</FONT></P>

      <P><FONT face=Arial size=2>Note that the BPB and Boot Sector layouts for 

      FAT12 and FAT16 are identical. For this reason a show only the FAT12 and 

      FAT32 structures.</FONT></P>

      <P><FONT face="Courier New" size=2><I>; BPB for FAT12 and FAT16 

      volumes</I></FONT></P>

      <TABLE border=0 cellPadding=0 width=405>

        <TBODY>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2><STRONG>BPB_FAT12</STRONG></FONT></TD>

          <TD width=105><FONT face="Courier New" 

            size=2><STRONG>STRUC</STRONG></FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

            size=2>(offset)</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbBytesPerSector</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x0B</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbSectorsPerCluster</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x0D</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbReservedSectors</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x0E</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpbNumberOfFATs</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x10</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpbRootEntries</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x11</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpbTotalSectors</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x13</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bpbMedia</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x15</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpbSectorsPerFAT</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x16</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbSectorsPerTrack</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x18</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbHeadsPerCylinder</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x1A</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpbHiddenSectors</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DD ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x1C</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbTotalSectorsBig</FONT></TD>

          <TD width=105><FONT face="Courier New" size=2>DD ?</FONT></TD>

          <TD align=middle width=85><FONT face="Courier New" 

          size=2>0x20</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2><STRONG>BPB_FAT12</STRONG></FONT></TD>

          <TD width=105><FONT face="Courier New" 

            size=2><STRONG>ENDS</STRONG></FONT></TD></TR></TBODY></TABLE>

      <P><FONT face="Courier New" size=2><I>; BPB for FAT32 

      volumes</I></FONT></P>

      <TABLE border=0 cellPadding=0 width=405>

        <TBODY>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2><STRONG>BPB_FAT32</STRONG></FONT></TD>

          <TD width=110><FONT face="Courier New" 

            size=2><STRONG>STRUC</STRONG></FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

            size=2>(offset)</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbBytesPerSector</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x0B</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbSectorsPerCluster</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x0D</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbReservedSectors</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x0E</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpbNumberOfFATs</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x10</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpbRootEntries</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x11</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpbTotalSectors</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x13</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bpbMedia</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x15</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpbSectorsPerFAT</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x16</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbSectorsPerTrack</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x18</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbHeadsPerCylinder</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x1A</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpbHiddenSectors</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DD ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x1C</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpbTotalSectorsBig</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DD ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x20</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpb32SectorsPerFAT</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DD ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x24</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bpb32Flags</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x28</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bpb32Version</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x2A</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpb32RootCluster</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DD ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x2C</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bpb32InfoSector</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x30</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bpb32BootBackupStart</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DW ?</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x32</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

size=2>bpb32Reserved</FONT></TD>

          <TD width=110><FONT face="Courier New" size=2>DB 12 DUP 

(?)</FONT></TD>

          <TD align=middle width=82><FONT face="Courier New" 

          size=2>0x34</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2><STRONG>BPB_FAT32</STRONG></FONT></TD>

          <TD width=110><FONT face="Courier New" 

            size=2><STRONG>ENDS</STRONG></FONT></TD></TR></TBODY></TABLE>

      <P><FONT face="Courier New" size=2><I>; Boot Sector layout for FAT12 and 

      FAT16</I></FONT></P>

      <TABLE border=0 cellPadding=0 width=502>

        <TBODY>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2><STRONG>BS_FAT12</STRONG></FONT></TD>

          <TD width=224><FONT face="Courier New" 

            size=2><STRONG>STRUC</STRONG></FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

            size=2>(offset)</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bsJmp</FONT></TD>

          <TD width=224><FONT face="Courier New" size=2>DB 3 DUP (?)</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x00</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bsOemName</FONT></TD>

          <TD width=224><FONT face="Courier New" size=2>DB 8 DUP (?)</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x03</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bsFAT12</FONT></TD>

          <TD width=224><FONT face="Courier New" size=2>BPB_FAT12 

            Structure</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x0B</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

size=2>bsDriveNumber</FONT></TD>

          <TD width=224><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x24</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bsUnused</FONT></TD>

          <TD width=224><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x25</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bsExtBootSignature</FONT></TD>

          <TD width=224><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x26</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bsSerialNumber</FONT></TD>

          <TD width=224><FONT face="Courier New" size=2>DD ?</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x27</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

size=2>bsVolumeLabel</FONT></TD>

          <TD width=224><FONT face="Courier New" size=2>DB "NO 

            NAME&nbsp;&nbsp;&nbsp; "</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x2B</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bsFileSystem</FONT></TD>

          <TD width=224><FONT face="Courier New" size=2>DB "FAT12&nbsp;&nbsp; 

            "</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x36</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bsBootCode</FONT></TD>

          <TD width=224><FONT face="Courier New" size=2>DB 450 DUP 

          (?)</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x3E</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2><STRONG>BS_FAT12</STRONG></FONT></TD>

          <TD width=224><FONT face="Courier New" 

            size=2><STRONG>ENDS</STRONG></FONT></TD></TR></TBODY></TABLE>

      <P><FONT face="Courier New" size=2><I>;Boot Sector layout for 

      FAT32</I></FONT></P>

      <TABLE border=0 cellPadding=0 width=501>

        <TBODY>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2><STRONG>BS_FAT32</STRONG></FONT></TD>

          <TD width=225><FONT face="Courier New" 

            size=2><STRONG>STRUC</STRONG></FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

            size=2>(offset)</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bsJmp</FONT></TD>

          <TD width=225><FONT face="Courier New" size=2>DB 3 DUP (?)</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x00</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bsOemName</FONT></TD>

          <TD width=225><FONT face="Courier New" size=2>DB 8 DUP (?)</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x03</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bsFAT32</FONT></TD>

          <TD width=225><FONT face="Courier New" size=2>BPB_FAT32 

            Structure</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x0B</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bs32DriveNumber</FONT></TD>

          <TD width=225><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x40</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bs32Unused</FONT></TD>

          <TD width=225><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x41</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2>bs32ExtBootSignature</FONT></TD>

          <TD width=225><FONT face="Courier New" size=2>DB ?</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x42</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bs32SerialNumber</FONT></TD>

          <TD width=225><FONT face="Courier New" size=2>DD ?</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x43</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bs32VolumeLabel</FONT></TD>

          <TD width=225><FONT face="Courier New" size=2>DB "NO 

            NAME&nbsp;&nbsp;&nbsp; "</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x47</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

          size=2>bs32FileSystem</FONT></TD>

          <TD width=225><FONT face="Courier New" size=2>DB 

            "FAT32&nbsp;&nbsp;&nbsp; "</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x52</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" size=2>bs32BootCode</FONT></TD>

          <TD width=225><FONT face="Courier New" size=2>DB 422 DUP 

          (?)</FONT></TD>

          <TD align=middle width=67><FONT face="Courier New" 

          size=2>0x5A</FONT></TD></TR>

        <TR>

          <TD width=250><FONT face="Courier New" 

            size=2><STRONG>BS_FAT32</STRONG></FONT></TD>

          <TD width=225><FONT face="Courier New" 

            size=2><STRONG>ENDS</STRONG></FONT></TD></TR></TBODY></TABLE>

      <P><FONT face=Arial size=2><B>File Allocation Table Details</B></FONT></P>

      <P><FONT face=Arial size=2>It&#8217;s time to mention clusters again. The 

      0<SUP>th</SUP> and 1<SUP>st</SUP> FAT entries are reserved and contain 

      some special information. The 2<SUP>nd</SUP> entry and up tells you the 

      state of the corresponding cluster in the data area. </FONT></P>

      <P><FONT face=Arial size=2>A value of zero indicates that the cluster 

      represented by that FAT entry is available and can be used when allocating 

      new space for a file or directory.</FONT></P>

      <P><FONT face=Arial size=2>A hexadecimal </FONT></P>

      <P><FONT face=Arial size=2>value in the range FFF8-FFFF indicates that the 

      cluster is the last in that chain of clusters. Yes, as you might have 

      guessed, this example is only valid for FAT16. Check out the table below 

      for cluster values for all FAT types:</FONT></P>

      <P><FONT face=Arial size=2><I>Cluster Values<BR></I></FONT></P>

      <TABLE border=1 cellPadding=7 cellSpacing=1 width=576>

        <TBODY>

        <TR>

          <TD vAlign=top width=93>&nbsp;</TD>

          <TD vAlign=top width=115><FONT face="Courier New" 

            size=2><B>FAT12</B></FONT></TD>

          <TD vAlign=top width=120><FONT face="Courier New" 

            size=2><B>FAT16</B></FONT></TD>

          <TD vAlign=top width=172><FONT face="Courier New" 

            size=2><B>FAT32</B></FONT></TD></TR>

        <TR>

          <TD vAlign=top width=93><FONT face="Courier New" 

            size=2>Available</FONT></TD>

          <TD vAlign=top width=115><FONT face="Courier New" 

          size=2>000</FONT></TD>

          <TD vAlign=top width=120><FONT face="Courier New" 

          size=2>0000</FONT></TD>

          <TD vAlign=top width=172><FONT face="Courier New" 

            size=2>00000000</FONT></TD></TR>

        <TR>

          <TD vAlign=top width=93><FONT face="Courier New" 

            size=2>Reserved</FONT></TD>

          <TD vAlign=top width=115><FONT face="Courier New" 

          size=2>001</FONT></TD>

          <TD vAlign=top width=120><FONT face="Courier New" 

          size=2>0001</FONT></TD>

          <TD vAlign=top width=172><FONT face="Courier New" 

            size=2>00000001</FONT></TD></TR>

        <TR>

          <TD vAlign=top width=93><FONT face="Courier New" size=2>User 

            Data</FONT></TD>

          <TD vAlign=top width=115><FONT face="Courier New" 

            size=2>002-FF6</FONT></TD>

          <TD vAlign=top width=120><FONT face="Courier New" 

            size=2>0002-FFF6</FONT></TD>

          <TD vAlign=top width=172><FONT face="Courier New" 

            size=2>00000002-0FFFFFF6</FONT></TD></TR>

        <TR>

          <TD vAlign=top width=93><FONT face="Courier New" size=2>Bad 

            Cluster</FONT></TD>

          <TD vAlign=top width=115><FONT face="Courier New" 

          size=2>FF7</FONT></TD>

          <TD vAlign=top width=120><FONT face="Courier New" 

          size=2>FFF7</FONT></TD>

          <TD vAlign=top width=172><FONT face="Courier New" 

            size=2>0FFFFFF7</FONT></TD></TR>

        <TR>

          <TD vAlign=top width=93><FONT face="Courier New" size=2>End 

            Marker</FONT></TD>

          <TD vAlign=top width=115><FONT face="Courier New" 

            size=2>FF8-FFF</FONT></TD>

          <TD vAlign=top width=120><FONT face="Courier New" 

            size=2>FFF8-FFFF</FONT></TD>

          <TD vAlign=top width=172><FONT face="Courier New" 

            size=2>0FFFFFF8-0FFFFFFF</FONT></TD></TR></TBODY></TABLE>

      <P><FONT face=Arial size=2>If you have a closer look at the FAT32 values, 

      you&#8217;ll see that only they are actually 28-bits long. This is actually 

      correct. The upper nibble is stated by Microsoft as being reserved and 

      might have a special meaning in future FAT32 implementations.</FONT></P>

      <P><FONT face=Arial size=2>They also tell you that you should mask the 

      bits off when interpreting the FAT. Also, care should be taken to preserve 

      the upper bits when changing the FAT. <BR></FONT></P>

      <DIR>

      <LI><FONT face=Arial size=2><I>If I remember correctly, the wonderful MS 

      FAT overview document states that a format utility should initialise the 

      reserved bits to zero. If the meaning of those bits are changed 

      dramatically the FAT32 version number in the Boot Record will most likely 

      also change. Currently the version number is zero.</I></FONT> </LI></DIR>

      <P><FONT face=Arial size=2>The MS document tells us that the FAT type is 

      determined by how many clusters there is room for in the user data area. 

      Have a look at the table below:</FONT></P>

      <P><FONT face=Arial size=2><I>FAT Type Determination<BR></I></FONT></P>

      <TABLE border=1 cellPadding=7 cellSpacing=1 width=423>

        <TBODY>

        <TR>

          <TD vAlign=top width="31%">&nbsp;</TD>

          <TD vAlign=top width="25%">

            <P align=center><FONT face="Courier New" 

            size=2><B>FAT12</B></FONT></P></TD>

          <TD vAlign=top width="22%">

            <P align=center><FONT face="Courier New" 

            size=2><B>FAT16</B></FONT></P></TD>

          <TD vAlign=top width="22%">

            <P align=center><FONT face="Courier New" 

            size=2><B>FAT32</B></FONT></P></TD></TR>

        <TR>

          <TD vAlign=top width="31%">

            <P align=center><FONT face="Courier New" size=2># of 

            clusters</FONT></P></TD>

          <TD vAlign=top width="25%">

            <P align=center><FONT face="Courier New" size=2>n-4084</FONT></P></TD>

          <TD vAlign=top width="22%">

            <P align=center><FONT face="Courier New" 

          size=2>4085-65524</FONT></P></TD>

          <TD vAlign=top width="22%">

            <P align=center><FONT face="Courier New" 

        size=2>65525-n</FONT></P></TD></TR></TBODY></TABLE>

      <P><FONT face=Arial size=2>As seen in the previous table, 11 values were 

      reserved for other purposes, which tells us to simply subtract that number 

      from the maximum number of values represented by a 12-bit, 16-bit and 

      28-bit number respectively (remember that the upper 4-bits are reserved in 

      FAT32).</FONT></P>

      <P><FONT face=Arial size=2>This does not match what the MS document says 

      unfortunately. The MS numbers are one less that when just taking account 

      for the reserved values. Since the document explicitly states that THIS 

      INFORMATION IS CORRECT and the NUMBERS ARE CORRECT we must obey and use 

      those numbers instead of the ones I really want to use.</FONT></P>

      <P><FONT face=Arial size=2>If you take a look at another of "my" documents 

      </FONT><A href="http://home.no.net/tkos/info/fat32.html"><FONT face=Arial 

      size=2>FAT32.HTML</FONT></A><FONT face=Arial size=2>, which was actually 

      written by Microsoft, they use "my" numbers. The actual statement 

      is:</FONT></P>

      <BLOCKQUOTE>

        <P><FONT face=Arial size=2><EM>FAT12 Less than 4086 clusters<BR>FAT16 

        Between 4096 and 65526 clusters<BR>FAT32 Greater than 65526 

        clusters.<BR></EM></FONT></P></BLOCKQUOTE>

      <P><FONT face=Arial size=2>The size of the data area is determined using 

      the horrible pseudo-formulas shown below. I split the formula into smaller 

      logical parts, simply because it looked horrible all in one 

      go.<BR></FONT></P>

      <DIR>

      <LI><FONT face=Arial size=2><I>Root_Sectors = Root_Directory_Entries * 32 

      / Bytes_Per_Sector</I></FONT> 

      <P><FONT face=Arial size=2><I>FAT_Sectors = Number_Of_FATs * 

      Sectors_Per_FAT</I></FONT></P>

      <P><FONT face=Arial size=2><I>Data_Sectors = Total_Sectors &#8211; 

      (Reserved_Sectors + FAT_Sectors + Root_Sectors)</I></FONT></P>

      <P><FONT face=Arial size=2><I>Total_Clusters = Data_Sectors / 

      Sectors_Per_Cluster<BR></I></FONT></P></LI></DIR>

      <P><FONT face=Arial size=2>To locate the start sector of the data area you 

      can use the following formula:<BR></FONT></P>

      <DIR>

      <LI><FONT face=Arial size=2><I>Data_Area_Start = Reserved_Sectors + 

      FAT_Sectors + Root_Sectors</I></FONT> </LI></DIR>

      <P><FONT face=Arial size=2><B>Root Directory Details</B></FONT></P>

      <P><FONT face=Arial size=2>As stated in the overview section, the root 

      directory is formatted just like any other directory. See the directory 

      and LFN details section for information about the directory entry 

      format.</FONT></P>

      <P><FONT face=Arial size=2>FAT12 and FAT16 volumes have the root directory 

      located immediately following the file allocation table(s). The following 

      formula gives you the starting sector number for the root 

      directory:<BR></FONT></P>

      <DIR>

      <LI><FONT face=Arial size=2><I>Root_Starting_Sector = Reserved_Sectors + 

      FAT_Sectors</I></FONT> </LI></DIR>

      <P><FONT face=Arial size=2><I>See the formula in the previous example for 

      the </I><B><I>FAT_Sectors</I></B><I> details.</I></FONT></P>

      <P><FONT face=Arial size=2>On FAT32 volumes the root directory is made up 

      of an ordinary cluster chain. A field in the Boot Record will tell you the 

      initial cluster number. Once you&#8217;ve got the initial cluster number you can 

      easily get the starting sector number for FAT32 as well:<BR></FONT></P>

      <DIR>

      <LI><FONT face=Arial size=2><I>Root_Starting_Sector = ((Root_Cluster &#8211; 2) 

      * Sectors_Per_Cluser) + Data_Area_Start</I></FONT> </LI></DIR>

      <P><FONT face=Arial size=2>This is exactly the same way you would find the 

      starting sector number for a file or a directory. The 

      <I>Data_Area_Start</I> formula includes <I>Root_Sectors</I>, but that does 

      not apply to this formula. The Boot Record for a FAT32 volume will have 

      the field holding number of entries in the root directory set to zero 

      anyway.<BR></FONT></P>

      <P><FONT face=Arial size=2><B>Directory and LFN details</B></FONT></P>

      <P><FONT face=Arial size=2>I feel it is time to describe how directories 

      are implemented in the FAT file system. All directories except the root 

      directory for FAT12 and FAT16 drives are actually files. A file is a 

      stream of bytes located in the data area portion of the volume made up by 

      one or more clusters. The exact size of the file is recorded in the 

      directory structure.</FONT></P>

      <P><FONT face=Arial size=2>The size of directory files is not recorded 

      anywhere. Directories are always treated as being a multiple of the 

      cluster size. Directories will be expanded when a new entry is added and 

      the directory is already full.</FONT></P>

      <P><FONT face=Arial size=2>Note that the root directory for FAT12 and 

      FAT16 drives cannot be expanded. The size of the root directory for these 

      FAT types was determined when the volume was formatted.</FONT></P>

      <P><FONT face=Arial size=2>The directory is divided into small structures 

      called Directory Entries. Each directory entry is always exactly 32 bytes 

      long. The entry holds the name, attribute, size, date, time and initial 

      cluster number for the file or directory.</FONT></P>

      <P><FONT face=Arial size=2>The Long File Names supported with VFAT are 

      stored in addition to the short/normal name in entries preceding the short 

      name. The LFN entry is hidden from older utility software (basically older 

      MS-DOS versions) by using a traditionally illegal attribute 

      value.</FONT></P>

      <P><FONT face=Arial size=2>Long names are stored in UNICODE, which is the 

      16-bit successor of ASCII. Each UNICODE character normally appears as an 

      ASCII character followed by a null byte. </FONT></P>

      <P><FONT face=Arial size=2>Each LFN entry can hold up to 13 UNCODE 

      characters. If the long name is longer than that additional entries are 

      stored in the directory. Also note that the LFN entries are stored in 

      reverse order with the first part of the long name appearing just before 

      the short name entry.</FONT></P>

      <P><FONT face=Arial size=2><I>Normal/Short Entry Format<BR></I></FONT></P>

      <TABLE border=1 cellPadding=7 cellSpacing=1 width="100%">

        <TBODY>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>8 BYTEs</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Blank-padded 

            name</FONT> 

            <P><FONT face=Arial size=2>- The first byte tells you some special 

            information:</FONT></P>

            <P><FONT face=Arial size=2>00h &#8211; entry is available and no entry 

            beyond this one has been used.</FONT></P>

            <P><FONT face=Arial size=2>05h &#8211; first character is actually 

            E5h</FONT></P>

            <P><FONT face=Arial size=2>2Eh &#8211; first character is a dot; this is a 

            special entry. It can either be the "dot" or "dot-dot" entry, which 

            is present in all directories except the root directory. The "dot" 

            entry has a cluster number that points to the directory itself. The 

            "dot-dot" entry has a cluster number that points to the parent 

            directory (or null if the parent is the root directory)/</FONT></P>

            <P><FONT face=Arial size=2>E5h &#8211; entry has been erased and is 

            available.</FONT></P></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>3 BYTEs</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Blank-padded 

            extension</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 BYTE</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Attribute</FONT> 

            <P><FONT face=Arial size=2>- This field is bit-mapped. Only bits 0-4 

            should be used, bits 5-7 are said to be reserved. Note that the 

            special value of 0Fh indicates an LFN entry. The value 0Fh is an 

            otherwise illegal attribute value. </FONT></P>

            <P><FONT face=Arial size=2>- Older software might think that LFN 

            entries are "Read-Only System Hidden Volume Directories", even a 

            fool will realise that means "CAN&#8217;T TOUCH THIS, do, do-do-do, da, 

            do-do, da-da"&#8230;</FONT></P>

            <P><FONT face=Arial size=2>00001b &#8211; Read-Only</FONT></P>

            <P><FONT face=Arial size=2>00010b &#8211; System</FONT></P>

            <P><FONT face=Arial size=2>00100b &#8211; Hidden</FONT></P>

            <P><FONT face=Arial size=2>01000b &#8211; Volume</FONT></P>

            <P><FONT face=Arial size=2>10000b &#8211; Directory</FONT></P></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 BYTE</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Reserved, used by 

            Windows NT, Novell DELWATCH apparently uses this to store the 

            original first character for erased entries.</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 BYTE</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>10-ms unit&#8217;s 

            "Create Time" refinement (added with VFAT).</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 WORD</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Creation time 

            (added with VFAT).</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 WORD</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Creation date 

            (added with VFAT).</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 WORD</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Access date 

            (added with VFAT).</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 WORD</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>High 16-bits of 

            Cluster # (added with and used for FAT32).</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 WORD</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Update time (set 

            on creation as well)</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 WORD</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Update date (set 

            on creation as well)</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 WORD</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>16-bit Cluster 

            #</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 DWORD</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>File size in 

            bytes (always zero for directories).</FONT></TD></TR></TBODY></TABLE>

      <P><FONT face=Arial size=2>The time and date fields use the following 

      "packed" storage format:</FONT></P>

      <P><FONT face=Arial size=2><I>Packed Time:</I></FONT></P>

      <TABLE border=1 cellPadding=7 cellSpacing=1 width=319>

        <TBODY>

        <TR>

          <TD vAlign=top width="33%">

            <P align=center><FONT face="Courier New" 

            size=2><B>15:11</B></FONT></P></TD>

          <TD vAlign=top width="33%">

            <P align=center><FONT face="Courier New" 

            size=2><B>10:5</B></FONT></P></TD>

          <TD vAlign=top width="33%">

            <P align=center><FONT face="Courier New" 

          size=2><B>4:0</B></FONT></P></TD></TR>

        <TR>

          <TD vAlign=top width="33%">

            <P align=center><FONT face="Courier New" size=2>Hour</FONT></P></TD>

          <TD vAlign=top width="33%">

            <P align=center><FONT face="Courier New" size=2>Minute</FONT></P></TD>

          <TD vAlign=top width="33%">

            <P align=center><FONT face="Courier New" size=2>Second / 

          2</FONT></P></TD></TR></TBODY></TABLE>

      <P><FONT face=Arial size=2><I>Packed Date:</I></FONT></P>

      <TABLE border=1 cellPadding=7 cellSpacing=1 width=319>

        <TBODY>

        <TR>

          <TD vAlign=top width="33%">

            <P align=center><FONT face=Arial size=2><B>15:9</B></FONT></P></TD>

          <TD vAlign=top width="33%">

            <P align=center><FONT face=Arial size=2><B>8:5</B></FONT></P></TD>

          <TD vAlign=top width="33%">

            <P align=center><FONT face=Arial size=2><B>4:0</B></FONT></P></TD></TR>

        <TR>

          <TD vAlign=top width="33%">

            <P align=center><FONT face=Arial size=2>Year &#8211; 1980</FONT></P></TD>

          <TD vAlign=top width="33%">

            <P align=center><FONT face=Arial size=2>Month</FONT></P></TD>

          <TD vAlign=top width="33%">

            <P align=center><FONT face=Arial 

      size=2>Day</FONT></P></TD></TR></TBODY></TABLE>

      <P><FONT face=Arial size=2>I haven&#8217;t seen any official MS documentation on 

      LFN entries, but after studying directory sectors and reading lots about 

      it from various sources, including Ralf Brown&#8217;s Interrupt List, which you 

      BTW, should get from this location &#8211; &lt;insert WWW page here&gt;, I&#8217;ve 

      come to the conclusion that this information is very accurate.</FONT></P>

      <P><FONT face=Arial size=2>Also note that it&#8217;s merely a guess that the new 

      file access/creation time/date fields added with VFAT are stored in the 

      same format as the standard time/date fields.<BR></FONT></P>

      <P><FONT face=Arial size=2><I>Long File Name Entry 

      Format<BR></I></FONT></P>

      <TABLE border=1 cellPadding=7 cellSpacing=1 width="100%">

        <TBODY>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 BYTE</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>LFN Record 

            Sequence Number</FONT> 

            <P><FONT face=Arial size=2>- Bits 5:0 hold a 6-bit LFN sequence 

            number (1..63). Note that this number is one-based. This limits the 

            number of LFN entries per long name to 63 entries or 63 * 13 = 819 

            characters per name. </FONT></P>

            <P><FONT face=Arial size=2>- The longest filename I was able to 

            create using Windows 95 Explorer was 250 characters. I managed to 

            use a 251-character name when saving a file in Microsoft Word. I 

            don&#8217;t know if this is the limitation of the FS driver or if it is 

            limited at the application level.</FONT></P>

            <P><FONT face=Arial size=2>- Bit 6 is set for the last LFN record in 

            the sequence.</FONT></P>

            <P><FONT face=Arial size=2>- Bit 7 is set if the LFN record is an 

            erased long name entry or maybe if it is part of an erased long 

            name?</FONT></P></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>10 

BYTEs</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>5 UNICODE 

            characters, LFN first part.</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 BYTE</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Attribute</FONT> 

            <P><FONT face=Arial size=2>- This field contains the special value 

            of 0Fh, which indicates an LFN entry.</FONT></P></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 BYTE</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Reserved 

            (probably just set to zero).</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 BYTE</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Checksum of short 

            name entry, used to validate that the LFN entry belongs to the short 

            name entry following.</FONT> 

            <P><FONT face=Arial size=2>According to Ralf Brown&#8217;s interrupt list, 

            the checksum is computed by adding up all the short name characters 

            and rotating the intermediate value right by one bit position before 

            adding each character.</FONT></P></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>12 

BYTEs</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>6 UNICODE 

            characters, LFN second part.</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>1 WORD</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>Initial cluster 

            number, which is always zero for LFN entries.</FONT></TD></TR>

        <TR>

          <TD vAlign=top width="15%"><FONT face=Arial size=2>4 BYTEs</FONT></TD>

          <TD vAlign=top width="85%"><FONT face=Arial size=2>2 UNICODE 

            characters, LFN third part.</FONT></TD></TR></TBODY></TABLE>

      <P><FONT face=Arial size=2>The Long File Name entries include every single 

      character in the long name including the "dot" which is implied by short 

      names.</FONT></P>

      <P><FONT face=Arial size=2>The very last LFN entry will have a 

      null-terminator if less than 13 characters are stored in that long name 

      entry. If only 12 characters or less are stored the remainder of the long 

      name parts are filled with FFFFs.</FONT></P>

      <P align=center><FONT face=Arial size=2>- TK -</FONT></P></TD></TR>

  <TR>

    <TD>&nbsp;</TD></TR></TBODY></TABLE></CENTER></DIV></BODY>
<!-- Mirrored from bos.asmhackers.net/docs/filesystems/fat12-16-32/docs/File Allocation Table.htm by HTTrack Website Copier/3.x [XR&CO'2013], Tue, 07 Oct 2014 11:25:36 GMT -->
</HTML>

